package com.hyk.learning.dto;

import com.hyk.learning.remoting.transport.RpcRequestTransport;
import lombok.*;

import java.io.Serializable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @className: RpcRequest
 * @author: hyk199710
 * @description: TODO
 * @date: 2024/4/14 21:31
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Builder
@ToString
public class RpcRequest implements Serializable {
    private static final long serialVersionUID = 1905122041950251207L;
    private String requestId;
    private String interfaceName;
    private String methodName;
    private Object[] parameters;
    private Class<?>[] paramTypes;
    private String version;
    private String group;
    private int weight;
    private long warmupTS;
    private int timeout;
    private long startTime;

    public String getRpcServiceName() {
        return this.getInterfaceName() + this.getGroup() + this.getVersion();
    }

//    public RpcServiceProperties toRpcProperties() {
//        return RpcServiceProperties.builder().serviceName(this.getInterfaceName())
//                .version(this.getVersion())
//                .group(this.getGroup()).build();
//    }
}
